package com.tzl.design_pattern.decorator_pattern;

import java.math.BigDecimal;

/**
 * @author Zhilei Tang
 * @date Created in 2020/11/16 20:54
 */
public class CakeAddGrapeDecorator extends CakeDecorator {
  public CakeAddGrapeDecorator(Cake cake) {
    super(cake);
  }

  @Override
  public String getCakeMsg() {
    return super.getCakeMsg() + "+1个葡萄";
  }

  @Override
  public BigDecimal getPrice() {
    return super.getPrice().add(new BigDecimal("3.4"));
  }
}
